#include<bits/stdc++.h>
using namespace std;
int s[100005],maxx;

int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n,tmp,ans=0,t;
    memset(s,0,sizeof(s));
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>tmp;
        if(tmp>maxx)maxx=tmp;
        s[tmp]++;
        //cout<<s[tmp]<<endl;
    }
    tmp=0;
    for(int i=1;i<=maxx;i++)
    {
        if(s[i]!=0)
        {
            if(s[tmp]<=s[i])
            {
                //s[i]-=s[tmp];
                //ans+=s[tmp];
                s[tmp]=0;
                tmp=i;
            }
            else{
                s[tmp]-=s[i];
                s[i]+=s[tmp];
                s[tmp]=0;
                tmp=i;
                //ans+=s[i];
                //s[i]=0;
            }
        }
    }

    for(int i=1;i<=maxx;i++)ans+=s[i];
    //cout<<1111<<endl;
    cout<<ans;
}
